package com.skit.ecm.admin.retrofit;

import com.skit.common.bean.ActivityBean;
import com.skit.common.bean.StatusResult;
import com.skit.ecm.admin.bean.ApplyBean;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author shuike <a href="mailto:shuike007@gmail.com">Contact me.</a>
 * @version 1.0
 * @since 2020/5/27
 */
public interface ActivityProtocol {
    @GET("v1/activity/all")
    Call<StatusResult<List<ActivityBean>>> getActivityList(@Header("userToken") String token, @Query("limit") int limit, @Query("skip") int skip, @Query("type") int type);

    @GET("v1/activity/info")
    Call<StatusResult<ActivityBean>> getActivityInfo(@Query("id") int id, @Query("uid") int uid);

    @POST("v1/activity/add")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    Call<StatusResult<String>> addActivity(@Field("token") String token, @Field("data") String jsonData);

    @POST("v1/activity/apply")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    Call<StatusResult<String>> apply(@Field("token") String token, @Field("data") String jsonData);

    @POST("v1/activity/check")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    Call<StatusResult<String>> checkApply(@Field("uid") int uid, @Field("aid") int aid, @Field("status") int status, @Field("checkID") int checkID);


    @POST("v1/activity/changeStatus")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    Call<StatusResult<String>> changeStatus(@Field("token") String token, @Field("uid") int uid, @Field("aid") int aid, @Field("status") int status);


    @GET("v1/activity/type")
    Call<StatusResult<List<ActivityBean.TypeBean>>> getActivityType();


    @GET("v1/activity/applyList")
    Call<StatusResult<List<ApplyBean>>> getApplyList(@Query("aid") int aid, @Query("type") String type);

}
